home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / c_news / 05 / listings / fossil.h < prev    next >
C/C++ Source or Header  |  1988-03-04  |  6KB  |  123 lines

  1. /************************************************************************/ 
  2. /*                                                                      */ 
  3. /*                                 FOSSIL.H                                */ 
  4. /*                                                                          */ 
  5. /*                    Header file for use with FOSSIL.LIB                    */ 
  6. /*                                                                        */ 
  7. /************************************************************************/ 
  8.  
  9. /************************************************************************/ 
  10. /*                                                                      */ 
  11. /*                            LOW LEVEL FUNCTIONS                            */ 
  12. /*                                                                        */ 
  13. /************************************************************************/ 
  14.  
  15. unsigned int    f_rx(int port);
  16. unsigned int    f_stat(int port);
  17. unsigned int    f_peek(int port);
  18. unsigned int    f_keyrdnowait(void);
  19. unsigned int    f_keyrd(void);
  20. int                f_init(int port, int trigger, int * flag_address);
  21. int                f_txnowait(int port, int character);
  22. int                f_readblk(int port, int count, void * buffer);
  23. int                f_writeblk(int port, int count, void * buffer);
  24. void            f_tx(int port, int character);
  25. void            f_deinit(int port);
  26.  
  27. /************************************************************************/ 
  28. /*                                                                      */ 
  29. /*                             SUPPORT FUNCTIONS                            */ 
  30. /*                                                                        */ 
  31. /************************************************************************/ 
  32.  
  33. unsigned int    f_ctrlcchk(int port, int bitmask);
  34. unsigned int    f_getcurs(void);
  35. int                f_setbaud(int port, int rate_code);
  36. int                f_ttint(void);
  37. void            f_dtr(int port, int state);
  38. void            f_outflush(int port);
  39. void            f_outpurge(int port);
  40. void            f_inpurge(int port);
  41. void            f_flowctrl(int port, int bitmask);
  42. void            f_setcurs(int row, int column);
  43. void            f_wransi(int character);
  44. void            f_watchdog(int port, int state);
  45. void            f_wrbios(int character);
  46. void            f_reboot(int temprature);
  47. void            f_break(int port, int state);
  48. void            f_data(int port, int count, void * buffer);
  49.  
  50. /************************************************************************/ 
  51. /*                                                                      */ 
  52. /*          FUNCTIONS DEALING WITH TIMER TICKS, AND EXTERNAL API'S        */ 
  53. /*                                                                        */ 
  54. /************************************************************************/ 
  55.  
  56. unsigned int    f_insertfunc(void (far * func)());
  57. unsigned int    f_removefunc(void (far * func)());
  58. int                f_installapi(int api_byte, void (far * api)());
  59. int                f_removeapi(int api_byte, void (far * api)());
  60.  
  61. /************************************************************************/ 
  62. /*                                                                      */ 
  63. /*                      STRUCTURE REQUIRED BY f_data()                    */ 
  64. /*                                                                        */ 
  65. /************************************************************************/ 
  66.  
  67. struct _fossildata    {
  68.         int            strsiz;        /* size of the structure in bytes        */
  69.         char        majver;        /* FOSSIL spec driver conforms to        */
  70.         char        minver;        /* rev level of this specific driver    */
  71.         char far *    ident;        /* "FAR" pointer to ASCII ID string        */
  72.         int            ibufr;        /* size of the input buffer (bytes)        */
  73.         int            ifree;        /* number of bytes left in buffer        */
  74.         int            obufr;        /* size of the output buffer (bytes)    */
  75.         int            ofree;        /* number of bytes left in the buffer    */
  76.         char        swidth;        /* width of screen on this adapter        */
  77.         char        sheight;    /* height of screen    "     "            */
  78.         char        baud;        /* ACTUAL baud rate, computer to modem    */
  79. };
  80.  
  81. /************************************************************************/ 
  82. /*                                                                      */ 
  83. /*                 DEFINES FOR f_stat() RETURN CODE BIT MAP                */ 
  84. /*                                                                        */ 
  85. /************************************************************************/ 
  86.  
  87. #define        FST_DCD        0x0080        /* Carrier detect                    */
  88. #define        FST_RDA        0x0100        /* Received data available            */
  89. #define        FST_OVRN    0x0200        /* Overrun condition                */
  90. #define        FST_THRE    0x2000        /* Room available in output buf        */
  91. #define        FST_TSRE    0x4000        /* Output buffer empty                */
  92.  
  93. /************************************************************************/ 
  94. /*                                                                      */ 
  95. /*                      DEFINES FOR f_ctrlcchk() BITMAP                    */ 
  96. /*                                                                        */ 
  97. /************************************************************************/ 
  98.  
  99. #define        F_CTRLCCHK    0x0001        /* Control-C/K checking enable bit    */
  100. #define        F_XMITCTRL    0x0002        /* Transmitter enable bit            */
  101.  
  102. /************************************************************************/ 
  103. /*                                                                      */ 
  104. /*                     DEFINES FOR f_reboot() PARAMETER                    */ 
  105. /*                                                                        */ 
  106. /************************************************************************/ 
  107.  
  108. #define        F_COLDBOOT    0x0000        /* Cold boot (memory test done)        */
  109. #define        F_WARMBOOT    0x0001        /* Warm boot                        */
  110.  
  111. /************************************************************************/ 
  112. /*                                                                      */ 
  113. /*                   MACROS FOR VARIOUS STATUS INDICATIONS                */ 
  114. /*                                                                        */ 
  115. /************************************************************************/ 
  116.  
  117. #define        f_cd(port)        ((f_status(port)&FS_CD)     ? 1 : 0)
  118. #define        f_rda(port)        ((f_status(port)&FS_RDA) ? 1 : 0)
  119. #define        f_ovrn(port)    ((f_status(port)&FS_OVRN)? 1 : 0)
  120. #define        f_thre(port)    ((f_status(port)&FS_THRE)? 1 : 0)
  121. #define        f_tsre(port)    ((f_status(port)&FS_TSRE)? 1 : 0)
  122.  
  123.